(Quick Reference)
create-script
Purpose
The
create-script
command creates a new Grails code generation script that can be run with the
grails
command from a terminal window.
Examples
The command:
grails create-script my-script
Creates a script called
src/main/scripts/my-script.groovy
such as:
description "Example description", "grails example-usage"println "Example Script"
The command can then be run with:
Description
Each script extends from the super class
GroovyScriptCommand which provides an API for achieving a number of different tasks.
Invoking Gradle
You can invoke Gradle using the
gradle
property:
You can run any other Grails scripts by simply invoking the method:
Code generation can be performed using the
TemplateRenderer API